<?php if (!defined('THINK_PATH')) exit(); /*a:3:{s:48:"D:\webroot\tongji/app/admin\view\users\edit.html";i:1543500506;s:49:"D:\webroot\tongji/app/admin\view\common\head.html";i:1535850094;s:49:"D:\webroot\tongji/app/admin\view\common\foot.html";i:1535850094;}*/ ?>
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title><?php echo config('sys_name'); ?>后台管理</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
  <link rel="stylesheet" href="/layuiadmin/layui/css/layui.css" media="all">
  <link rel="stylesheet" href="/layuiadmin/style/admin.css" media="all">
  
  <script>
  /^http(s*):\/\//.test(location.href) || alert('请先部署到 localhost 下再访问');
  </script>
</head>

<div class="layui-fluid" ng-app="hd" ng-controller="ctrl"><div class="layui-card"><div class="layui-card-body">
    <fieldset class="layui-elem-field layui-field-title">
        <legend><?php echo $title; ?></legend>
    </fieldset>
    <form class="layui-form layui-form-pane">
        <div class="layui-form-item">
            <label class="layui-form-label">所属用户组</label>
                <div class="layui-input-inline">
                <select name="level" lay-verify="required" >
				     <option value="0" <?php if($user['leve'] == 0): ?>selected<?php endif; ?>>F0</option>
                    <?php if(is_array($user_level) || $user_level instanceof \think\Collection || $user_level instanceof \think\Paginator): $i = 0; $__LIST__ = $user_level;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?>
					  <option value="<?php echo $vo['id']; ?>" <?php if($user['leve'] == $vo['id']): ?>selected<?php endif; ?>>F<?php echo $vo['id']; ?></option>
					<?php endforeach; endif; else: echo "" ;endif; ?>
                </select>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">登录帐户</label>
                <div class="layui-input-inline">
                <input type="text" name="username" ng-model="field.username" lay-verify="required" placeholder="<?php echo lang('pleaseEnter'); ?><?php echo lang('nickname'); ?>" class="layui-input">
            </div>
        </div>
		<div class="layui-form-item">
            <label class="layui-form-label">呢称</label>
                <div class="layui-input-inline">
                <input type="text" name="nickname" ng-model="field.nickname" lay-verify="required" placeholder="请输入呢称" class="layui-input">
            </div>
        </div>
		
		<div class="layui-form-item">
            <label class="layui-form-label">签名</label>
                <div class="layui-input-inline">
                <input type="text" name="sign_msg" ng-model="field.sign_msg" lay-verify="required" placeholder="请输入签名" class="layui-input">
            </div>
        </div>
		
		<div class="layui-form-item">
            <label class="layui-form-label">上级会员ID</label>
                <div class="layui-input-inline">
                <input type="text" name="parent_id" ng-model="field.parent_id" lay-verify="required" placeholder="请输入上级会员ID" class="layui-input">
				
            </div>
			<div class="layui-form-mid layui-word-aux" style='color:red !important;'>
                谨慎操作!
            </div>
        </div>
       
        <div class="layui-form-item">
            <label class="layui-form-label"><?php echo lang('tel'); ?></label>
                <div class="layui-input-inline">
                <input type="text" name="mobile" ng-model="field.mobile" lay-verify="mobile" placeholder="输入<?php echo lang('tel'); ?>" class="layui-input">
            </div>
            <div class="layui-form-mid layui-word-aux">
                只能填写数字
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label"><?php echo lang('pwd'); ?></label>
                <div class="layui-input-inline">
                <input type="password" name="password" placeholder="输入<?php echo lang('pwd'); ?>" class="layui-input">
            </div>
            <div class="layui-form-mid layui-word-aux">
                密码必须大于6位，小于15位
            </div>
        </div>
        
        <div class="layui-form-item">
            <label class="layui-form-label">FOS数量</label>
                <div class="layui-input-inline">
                <input type="text" name="coin" ng-model="field.coin" placeholder="输入FOS数量" class="layui-input">
            </div>
			<div class="layui-form-mid layui-word-aux">
                谨慎操作!
            </div>
        </div>
        
        <div class="layui-form-item">
            <div class="layui-input-block">
                <button type="button" class="layui-btn" lay-submit="" lay-filter="submit"><?php echo lang('submit'); ?></button>
                <a href="<?php echo url('index'); ?>" class="layui-btn layui-btn-primary"><?php echo lang('back'); ?></a>
            </div>
        </div>
    </form>
</div>
</div>
</div>
<script src="/layuiadmin/layui/layui.js"></script>  
<script src="__STATIC__/common/js/angular.min.js"></script>
<script>
    var m = angular.module('hd',[]);
    m.controller('ctrl',function($scope) {
        $scope.field = <?php echo $info; ?>;
        layui.use(['form', 'layer'], function () {
            var form = layui.form, layer = layui.layer,$= layui.jquery;
            
            form.on('select(city)', function(data) {
                var pid = data.value;
                var loading = layer.load(1, {shade: [0.1, '#fff']});
                $.get("<?php echo url('getRegion'); ?>?pid=" + pid, function (data) {
                    layer.close(loading);
                    var html='<option value="">请选择县/区</option>';
                    $.each(data, function (i, value) {
                        html += '<option value="number:'+value.id+'">'+value.name+'</option>';
                    });
                    $('#district').html(html);

                    form.render()
                });
            });
            form.on('submit(submit)', function (data) {
                // 提交到方法 默认为本身
                var loading = layer.load(1, {shade: [0.1, '#fff']});
                data.field.id = $scope.field.id;
                $.post("", data.field, function (res) {
                    layer.close(loading);
                    if (res.code > 0) {
                        layer.msg(res.msg, {time: 1800, icon: 1}, function () {
                            location.href = res.url;
                        });
                    } else {
                        layer.msg(res.msg, {time: 1800, icon: 2});
                    }
                });
            })
        });
    });
</script>
</body>
</html>